<template>
  <div class='info'>
    <Search btns="1-1-1" :searchData="searchData" :search="search"></Search>
    <Table btns="1-1-2" :tableData="tableData" :tableTotable="false" :data0="data" :params="pageInfo" :search="search"></Table>
    <p style="display:none">{{getData}}</p>
  </div>
</template>
<script>
import Search from "../../common/search"
import Table from "../../common/table"
import MixIn from '../common/mixin.js'
export default {
  components: {Search,Table},
  name: "",
  data() {
    return {
      search:{
        division:"",
        name:"",
        number:"",
        party:"",
        education:"",
        degree:"",
        profession:"",
        lead:"",
        tutorship:"",
        specialty:"",
        specialty_type:"",
        duty:"",
        grade:"",
        search:"",
      },
      searchData:[
        {key:"division",name:"科室",type:"select",array:[]},
        {key:"name",name:"姓名",type:"input"},
        {key:"number",name:"职工号",type:"input"},
        {key:"party",name:"政治面貌",type:"select",array:[]},
        {key:"education",name:"学历",type:"input"},
        {key:"degree",name:"学位",type:"input"},
        {key:"profession",name:"职称",type:"input"},
        {key:"lead",name:"是否硕导",type:"select",array:["是","否"]},
        {key:"tutorship",name:"是否博导",type:"select",array:["是","否"]},
        {key:"specialty",name:"专业编制",type:"select",array:[]},
        {key:"specialty_type",name:"编制类型",type:"input"},
        {key:"duty",name:"职务",type:"select",array:[]},
        {key:"grade",name:"级别",type:"select",array:[]},
        {key:"search",name:"关键字",type:"input"},
      ],
      pageInfo:{
        page:1,
        total:0,
      },
      tableData:[
        {type:"index",name:"序号"},
        {prop:"name",name:"姓名",width:"120"},
        {prop:"number",name:"职工号",width:"120"},
        {prop:"division",name:"科室",width:"120"},
        {prop:"sex",name:"性别",width:"120"},
        {prop:"birthday",name:"出生年月",width:"120"},
        {prop:"age",name:"AGE",width:"120"},
        {prop:"birthplace",name:"籍贯",width:"120"},
        {prop:"nation",name:"民族",width:"120"},
        {prop:"party",name:"政治面貌",width:"120"},
        {prop:"party_time",name:"入党时间",width:"120"},
        {prop:"identity",name:"身份证号",width:"150",},
        {prop:"tel",name:"联系电话",width:"120",},
        {prop:"emergency_tel",name:"紧急联系电话",width:"150",},
        {prop:"address",name:"家庭住址",width:"200",},
        {prop:"work_time",name:"参加工作时间",width:"120",},
        {prop:"school_time",name:"入校时间",width:"120",},
        {prop:"school_finish",name:"毕业学校",width:"120",},
        {prop:"education",name:"学历及毕业时间",width:"120",},
        {prop:"degree",name:"学位及毕业时间",width:"120",},
        {prop:"profession",name:"职称(时间)",width:"120",},
        {prop:"lead",name:"是否硕导",width:"120",},
        {prop:"tutorship",name:"是否博导",width:"120",},
        {prop:"specialty",name:"专业编制",width:"120",},
        {prop:"specialty_type",name:"编制类型",width:"120",},
        {prop:"duty",name:"职务",width:"120",},
        {prop:"grade",name:"级别",width:"120",},
        {prop:"credentials",name:"持证情况",width:"120",},
        {prop:"email",name:"邮箱",width:"120",},

        {prop:"",name:"操作",width:"",},
      ],
      // 列表数据
      data:[{}],
      settime:null
    };
  },
  computed:{
    getData(){
      if(this.settime)clearTimeout(this.settime)
      var params={...this.search,...{page:this.pageInfo.page}}
      this.settime=setTimeout(()=>{
        this.getList(params)
        return true
      },500)
    },
  },
  methods: {
    getList(params){
      var goal=params||{...this.search,...this.pageInfo}
      _g.apiPost("teacherinfo/lists",goal).then(res=>{
        this.$set(this,"data",res.data.list)
        this.pageInfo.total=res.data.total
      })
    },

    getSelectData(){
      _g.apiPost("teacherinfo/getwhere").then(res=>{
        this.$set(this.searchData[0],"array",res.data.division)
        this.$set(this.searchData[12],"array",res.data.grade)
        this.$set(this.searchData[3],"array",res.data.party)
        this.$set(this.searchData[9],"array",res.data.specialty)
        this.$set(this.searchData[11],"array",res.data.duty)
      })
    }
  },
  created() {
  },
  mixins:[MixIn],
};
</script>
<style scoped>
.info{
  background-color: #fff;
}
</style>